<template>
    <!-- 高度300px -->
  <div class="py-5 h-max min-h-[300px]">
    <div class="text-gray-600 text-xs">ADVERTISEMENT</div>
    <!-- GAM广告 -->
     <AdsGoogleAdManager
        v-if="gamEnable"
        :slot-type="slotType"
        @adSuccess="successGAMLoaded = true"
        @onNullAd="successGAMLoaded = false"
     />
     <AdsGoogleAdAdsense
        v-if="!successGAMLoaded && adsEnable"
        :slot-type="slotType"
     />
  </div>
</template>

<script setup>

const props = defineProps({
    slotType: {
        type: String,
        required: true
    }
})

const successGAMLoaded = ref(false)

// 获取配置信息是否closeGAM广告和AFC广告
const hostname = useHostname()
const adsEnable = getAdsEnable(hostname)
const gamEnable = getGamEnable(hostname)

// 添加调试信息
onMounted(() => {
})
</script>

<style scoped >
  
</style>